package com.alibaba.alink.operator.batch.dataproc;

import org.apache.flink.types.Row;

import com.alibaba.alink.operator.batch.BatchOperator;
import com.alibaba.alink.operator.batch.dataproc.format.ColumnsToCsvBatchOp;
import com.alibaba.alink.operator.batch.dataproc.format.ColumnsToJsonBatchOp;
import com.alibaba.alink.operator.batch.dataproc.format.ColumnsToKvBatchOp;
import com.alibaba.alink.operator.batch.dataproc.format.CsvToColumnsBatchOp;
import com.alibaba.alink.operator.batch.dataproc.format.JsonToColumnsBatchOp;
import com.alibaba.alink.operator.batch.dataproc.format.KvToColumnsBatchOp;
import com.alibaba.alink.operator.batch.source.MemSourceBatchOp;
import com.alibaba.alink.testutil.AlinkTestBase;
import org.junit.Test;

public class FormatTransOperatorTest extends AlinkTestBase {

	private BatchOperator getData() {
		Row[] rows = new Row[] {
			Row.of(1L, "a,2.0,3.0", "f1=a,f2=2.0,f3=3.0", "{\"f1\":\"a\",\"f2\":2.0,\"f3\":3.0}", "2.0,3.0"),
			Row.of(2L, "a,2.0,3.b", "f1=a,f2=2.0,f3=3.0", "{\"f1\":\"a\",\"f2\":2.0,\"f3\":\"3.0\"}", "2.0,3.b"),
		};

		return new MemSourceBatchOp(rows,
			new String[] {"id", "csv", "kv", "json", "vec"});

	}

	@Test
	public void testToColumns() throws Exception {
		BatchOperator data = getData();
		BatchOperator output1 = new CsvToColumnsBatchOp().setCsvCol("csv").setReservedCols("id")
			.setSchemaStr("f1 string, f2 double, f3 string").linkFrom(data).lazyCollect();
		BatchOperator output2 = new KvToColumnsBatchOp().setKvCol("kv").setReservedCols("id")
			.setKvValDelimiter("=")
			.setSchemaStr("f1 string, f2 double, f3 double").linkFrom(data).lazyCollect();
		BatchOperator output3 = new JsonToColumnsBatchOp().setJsonCol("json").setReservedCols("id")
			.setHandleInvalid("skip")
			.setSchemaStr("f1 string, f2 double, f4 string").linkFrom(data).lazyCollect();
		BatchOperator.execute();
	}

	@Test
	public void testFromColumns() throws Exception {
		BatchOperator data = getData();
		BatchOperator output1 = new ColumnsToCsvBatchOp().setSelectedCols("id", "csv").setReservedCols("id")
			.setSchemaStr("id bigint, csv string")
			.setCsvCol("csv").linkFrom(data).lazyCollect();
		BatchOperator output2 = new ColumnsToKvBatchOp().setKvCol("kv").setSelectedCols("id", "kv").setReservedCols(
			"id")
			.setKvColDelimiter("~")
			.linkFrom(data).lazyCollect();
		BatchOperator output3 = new ColumnsToJsonBatchOp().setJsonCol("json").setReservedCols("id")
			.setSelectedCols("id", "json")
			.linkFrom(data).lazyCollect();
		BatchOperator.execute();
	}

	@Test
	public void parse() throws Exception {
		String s = "{\"youxuanke_weekly_times\": 1, \"lp_last_call_end\": 0, \"uid\": \"7541673\", "
			+ "\"youxuanke_course_subject\": \"\", \"baopinke_course_num\": 1, \"all_course_num\": 92, \"rebuy_term\":"
			+ " 0, \"labels\": {}, \"youxuanke_course_num\": 0, \"sex\": \"2\", \"course\": {\"qwe\": [\"47\", "
			+ "\"3\", \"2\", \"23\"], \"qwer\": 2, \"19_0_5\": [\"64\"], \"18-2-111\": [\"2\"], "
			+ "\"19_0_3\": [\"3\", \"59\"], \"all_course_num\": 92, \"18-0-221\": [\"1\", \"3\", \"2\", \"21\"], "
			+ "\"18_4_2\": [\"3\", \"2\"], \"20-3-221\": [\"3\"], \"19_1_3\": [\"3\"], \"19_1_2\": [\"26\", \"59\", "
			+ "\"3\"], \"18_0_5\": [\"42\"], \"18_0_4\": [\"21\", \"42\", \"30\", \"28\", \"43\", \"1\", \"3\", "
			+ "\"2\"], \"19-4-219\": [\"26\"], \"18_0_3\": [\"3\", \"2\"], \"18_3_2\": [\"3\", \"2\"], \"19-7-111\": "
			+ "[\"3\", \"2\"], \"19-4-221\": [\"3\"], \"no_return_long_term_live_subject\": [\"3\", \"2\", \"59\", "
			+ "\"26\"], \"19_7_2\": [\"3\", \"2\"], \"19_8_2\": [\"3\", \"2\"], \"short_49_subject_list\": [], "
			+ "\"19-0-411\": [\"47\", \"64\", \"23\"], \"19_2_2\": [\"3\", \"2\"], \"long_term_live_subject\": [\"3\","
			+ " \"2\", \"59\", \"26\"], \"19-1-221\": [\"3\"], \"finished_within_15days_course\": {\"19_0_4\": "
			+ "[\"2\"], \"19-0-221\": [\"2\"]}, \"no_return_course_list\": [\"55719\", \"69213\", \"59533\", "
			+ "\"75471\", \"57442\", \"54664\", \"75358\", \"76010\", \"60483\", \"79538\", \"48600\", \"76093\", "
			+ "\"74418\", \"80968\", \"81243\", \"76193\", \"71856\", \"56286\", \"72818\", \"99504\", \"71954\", "
			+ "\"56464\", \"57104\", \"56466\", \"56460\", \"56461\", \"56462\", \"72351\", \"99869\", \"83837\", "
			+ "\"75518\", \"50538\", \"48582\", \"56427\", \"84225\", \"66443\", \"73893\", \"84223\", \"56503\", "
			+ "\"80530\", \"59314\", \"56504\", \"56465\", \"66147\", \"76211\", \"75907\", \"87374\", \"72599\", "
			+ "\"56482\", \"56502\", \"53145\", \"74818\", \"76203\", \"56455\", \"74419\", \"56454\", \"60533\", "
			+ "\"85033\", \"50352\", \"52600\", \"80833\", \"55973\", \"69795\", \"106626\", \"99423\", \"56463\", "
			+ "\"63266\", \"81466\", \"56556\", \"73886\", \"71622\", \"56459\", \"56458\", \"54909\", \"79715\", "
			+ "\"97152\", \"56457\", \"56456\", \"81018\", \"56453\", \"56452\"], \"18-2-122\": [\"3\"], \"20-2-221\":"
			+ " [\"3\"], \"reading_long_term_live_subject\": [], \"18-1-111\": [\"3\", \"2\"], "
			+ "\"no_return_course_num\": 83, \"finished_within_7days_course\": {\"19_0_4\": [\"2\"], \"19-0-221\": "
			+ "[\"2\"]}, \"19-0-221\": [\"3\", \"2\", \"59\"], \"long_term_live_num\": 34, \"19-1-111\": [\"26\", "
			+ "\"59\", \"3\"], \"no_return_course_subject\": [\"26\", \"59\", \"21\", \"23\", \"42\", \"30\", \"28\", "
			+ "\"43\", \"1\", \"3\", \"2\", \"64\", \"47\"], \"19-4-111\": [\"26\", \"59\", \"3\"], \"20-2-111\": "
			+ "[\"3\", \"59\", \"26\"], \"20_2_3\": [\"3\"], \"18-4-111\": [\"3\", \"2\"], \"19-2-111\": [\"3\", "
			+ "\"2\"], \"20-3-111\": [\"3\", \"59\", \"26\"], \"all_course_subject\": [\"26\", \"59\", \"21\", \"23\","
			+ " \"42\", \"30\", \"28\", \"43\", \"1\", \"3\", \"2\", \"64\", \"47\"], \"20_0_3\": [\"3\", \"26\"], "
			+ "\"20_0_4\": [\"3\"], \"about_to_start_course\": {\"20-0-221\": [\"26\"], \"20_0_3\": [\"26\"]}, "
			+ "\"reading_long_term_live_num\": 3, \"20-0-221\": [\"3\", \"26\"], \"course_list\": [\"55719\", "
			+ "\"69213\", \"59533\", \"75471\", \"57442\", \"54664\", \"75358\", \"60485\", \"76010\", \"60483\", "
			+ "\"79538\", \"48600\", \"55973\", \"74418\", \"80968\", \"81243\", \"76193\", \"71856\", \"56286\", "
			+ "\"72818\", \"50352\", \"71954\", \"56464\", \"57104\", \"56466\", \"56460\", \"56461\", \"56462\", "
			+ "\"72351\", \"99869\", \"83837\", \"75518\", \"50538\", \"48582\", \"56427\", \"84225\", \"66443\", "
			+ "\"73893\", \"84223\", \"56503\", \"80530\", \"59314\", \"99504\", \"56504\", \"56465\", \"66147\", "
			+ "\"76211\", \"75907\", \"87374\", \"72599\", \"56482\", \"56502\", \"53145\", \"74818\", \"76203\", "
			+ "\"56455\", \"74419\", \"56454\", \"60533\", \"85033\", \"72190\", \"52600\", \"60535\", \"80833\", "
			+ "\"76093\", \"69795\", \"106626\", \"99423\", \"56463\", \"63266\", \"81466\", \"56556\", \"73886\", "
			+ "\"71622\", \"56459\", \"56458\", \"54909\", \"79715\", \"97152\", \"56457\", \"56456\", \"81018\", "
			+ "\"56453\", \"56452\"], \"18-3-111\": [\"3\", \"2\"], \"on_going_course\": {\"19-0-411\": [\"47\", "
			+ "\"64\", \"23\"], \"19_0_4\": [\"47\", \"3\", \"2\", \"23\"], \"19_0_5\": [\"64\"], \"20_3_3\": [\"3\"],"
			+ " \"18-0-221\": [\"1\"], \"20-3-221\": [\"3\"], \"20-3-111\": [\"3\", \"59\", \"26\"], \"18_0_4\": "
			+ "[\"1\", \"28\", \"30\", \"42\", \"43\"], \"18-0-411\": [\"28\", \"30\", \"42\", \"43\"], \"20-0-221\": "
			+ "[\"3\"], \"20_0_4\": [\"3\"], \"20_3_2\": [\"3\", \"59\", \"26\"], \"19-0-221\": [\"3\", \"2\"]}, "
			+ "\"18_1_2\": [\"3\", \"2\"], \"19-0-231\": [\"3\"], \"no_return_long_term_live_num\": 26, "
			+ "\"final_plan_timestamp\": {\"18-0-221\": 1643558400.0, \"20-3-221\": 1609759200.0, \"20-3-111\": "
			+ "1609666800.0, \"19-7-111\": 1569407400.0, \"18-2-111\": 1533353400.0, \"19-4-221\": 1579782000.0, "
			+ "\"18-1-111\": 1561545600.0, \"19-0-411\": 1610640000.0, \"19-1-221\": 1592828400.0, \"19-1-111\": "
			+ "1592733000.0, \"18-0-411\": 1610985600.0, \"20-0-221\": 1631376000.0, \"20-2-111\": 1598443200.0, "
			+ "\"18-2-122\": 1532318400.0, \"19-4-111\": 1581336600.0, \"18-4-111\": 1550235600.0, \"19-2-111\": "
			+ "1565341200.0, \"18-3-111\": 1547635200.0, \"19-4-219\": 1577448600.0, \"19-0-231\": 1576756800.0, "
			+ "\"20-2-221\": 1597407600.0, \"19-8-111\": 1578479400.0, \"19-0-221\": 1612800000.0}, \"20_2_2\": "
			+ "[\"3\", \"59\", \"26\"], \"18-0-411\": [\"42\", \"30\", \"28\", \"43\"], \"19-8-111\": [\"3\", \"2\"], "
			+ "\"19_4_2\": [\"26\", \"59\", \"3\"], \"19_4_3\": [\"3\"], \"20_3_3\": [\"3\"], \"20_3_2\": [\"3\", "
			+ "\"59\", \"26\"], \"19_4_7\": [\"26\"]}, \"baopinke_times\": 3, \"curterm_course_num\": 3, "
			+ "\"lastterm_course_num\": 3, \"id\": \"7537193\", \"youxuanke_last_interval\": 95335, "
			+ "\"first_login_timestamp\": 0, \"baopinke_weekly_times\": 1, \"android_first_login_sessid\": "
			+ "\"cba8a0c629a6c3b\", \"push_times\": 37, \"curterm_course_subject\": \"26|59|3\", \"user_mode\": "
			+ "\"consumer\", \"nextterm_course_subject\": \"3|59|26\", \"youxuanke_times\": 3, \"has_user_profile\": "
			+ "1, \"no_return_long_term_live_subject\": 4, \"baopinke_course_subject\": \"3\", \"country_id\": \"0\", "
			+ "\"baopinke_curterm_num\": 0, \"city_id\": \"200\", \"youxuanke_curterm_subject\": \"\", \"qita_times\":"
			+ " 31, \"ref_grade\": \"6\", \"status\": \"1\", \"lp_last_call_begin\": 0, \"baopinke_curterm_subject\": "
			+ "\"\", \"invite\": {}, \"qita_last_interval\": 414374, \"jingpinke_weekly_times\": 0, "
			+ "\"nextterm_course_num\": 3, \"auth\": \"1\", \"no_return_course_num\": 83, "
			+ "\"android_first_login_time\": \"1525071887912\", \"buy_subject_term\": "
			+ "\"19_4_3_3|19_1_2_26|20_0_4_3|18_0_4_21|18_0_3_2|18_4_2_2|18_4_2_3|18_0_4_43|18_0_4_42|20_3_2_59"
			+ "|19_0_4_3|19_0_4_2|19_0_4_23|18_0_4_28|20_0_3_3|18_2_2_2|18_2_2_3|19_4_2_26|19_4_7_26|19_1_3_3|18_0_4_2"
			+ "|18_0_4_3|18_0_3_3|19_1_2_3|19_8_2_3|19_8_2_2|20_0_3_26|20_2_2_26|19_0_5_64|19_0_4_47|18_0_4_1|19_2_2_3"
			+ "|19_2_2_2|18_1_2_3|18_1_2_2|19_7_2_2|19_7_2_3|19_0_3_59|18_0_4_30|20_3_2_26|19_1_2_59|19_4_2_3|20_2_2_3"
			+ "|20_3_3_3|20_2_3_3|19_4_2_59|18_0_5_42|19_0_3_3|20_3_2_3|18_3_2_3|18_3_2_2|20_2_2_59|20-3-221_3|20-2"
			+ "-221_3|20-3-111_59|19-1-221_3|18-1-111_3|20-2-111_3|18-0-221_21|19-2-111_2|19-2-111_3|19-0-221_2|19-0"
			+ "-221_3|18-0-411_43|18-0-411_42|20-3-111_3|18-0-221_1|19-0-221_59|19-1-111_3|19-8-111_2|20-0-221_3|18-0"
			+ "-411_28|19-8-111_3|18-1-111_2|19-4-111_59|19-7-111_3|19-7-111_2|20-3-111_26|19-4-111_3|19-1-111_59|19-4"
			+ "-221_3|18-3-111_2|18-3-111_3|20-2-111_59|18-2-122_3|18-0-411_30|19-0-231_3|20-0-221_26|19-4-219_26|20-2"
			+ "-111_26|19-0-411_23|19-1-111_26|18-0-221_3|18-0-221_2|19-0-411_64|18-2-111_2|19-4-111_26|18-4-111_3|18"
			+ "-4-111_2|19-0-411_47\", \"lp_last_ring\": 0, \"push_label\": {\"laodaixin-0\": {\"last_ad_timestamp\": "
			+ "1603801526, \"push_times\": 8, \"weekly_ad_date_list\": [\"2020-10-27\"], \"daily_times\": 0, "
			+ "\"last_ad_date\": \"2020-10-27\"}, \"weekly_ad_date_list\": [\"2020-10-27\", \"2020-10-26\", "
			+ "\"2020-10-28\", \"2020-10-30\", \"2020-10-31\", \"2020-11-01\"], \"daily_times\": 1, \"laodaixin-3\": "
			+ "{\"last_ad_timestamp\": 1598014538, \"push_times\": 1, \"weekly_ad_date_list\": [], \"daily_times\": 0,"
			+ " \"last_ad_date\": \"2020-08-21\"}, \"\\u54c1\\u724c\\u4ecb\\u7ecd-0\": {\"last_ad_timestamp\": "
			+ "1599001499, \"push_times\": 2, \"weekly_ad_date_list\": [], \"daily_times\": 0, \"last_ad_date\": "
			+ "\"2020-09-02\"}, \"last_ad_date\": \"2020-11-01\", \"last_ad_timestamp\": 1604213240, "
			+ "\"gongyizhibo-0\": {\"last_ad_timestamp\": 1602543133, \"push_times\": 3, \"weekly_ad_date_list\": [], "
			+ "\"daily_times\": 0, \"last_ad_date\": \"2020-10-13\"}, \"short_term_course_laodaixin-0\": "
			+ "{\"last_ad_timestamp\": 1604029232, \"push_times\": 14, \"weekly_ad_date_list\": [\"2020-10-30\"], "
			+ "\"daily_times\": 0, \"last_ad_date\": \"2020-10-30\"}, "
			+ "\"\\u4f18\\u9009\\u8bfe-\\u7279\\u8bad\\u73ed-0\": {\"last_ad_timestamp\": 1600692529, \"push_times\": "
			+ "1, \"weekly_ad_date_list\": [], \"daily_times\": 0, \"last_ad_date\": \"2020-09-21\"}, "
			+ "\"short_term_course-1\": {\"last_ad_timestamp\": 1604213240, \"push_times\": 16, "
			+ "\"weekly_ad_date_list\": [\"2020-11-01\"], \"daily_times\": 1, \"last_ad_date\": \"2020-11-01\"}, "
			+ "\"short_term_course-0\": {\"last_ad_timestamp\": 1597799643, \"push_times\": 3, "
			+ "\"weekly_ad_date_list\": [], \"daily_times\": 0, \"last_ad_date\": \"2020-08-19\"}, "
			+ "\"short_term_course-2\": {\"last_ad_timestamp\": 1604120565, \"push_times\": 3, "
			+ "\"weekly_ad_date_list\": [\"2020-10-31\"], \"daily_times\": 0, \"last_ad_date\": \"2020-10-31\"}, "
			+ "\"suyangke-0\": {\"last_ad_timestamp\": 1603373377, \"push_times\": 12, \"weekly_ad_date_list\": [], "
			+ "\"daily_times\": 0, \"last_ad_date\": \"2020-10-22\"}, \"baopinke-0\": {\"last_ad_timestamp\": "
			+ "1603709639, \"push_times\": 3, \"weekly_ad_date_list\": [\"2020-10-26\"], \"daily_times\": 0, "
			+ "\"last_ad_date\": \"2020-10-26\"}, \"weilaihao-0\": {\"last_ad_timestamp\": 1601977631, \"push_times\":"
			+ " 3, \"weekly_ad_date_list\": [], \"daily_times\": 0, \"last_ad_date\": \"2020-10-06\"}, "
			+ "\"\\u76f4\\u64ad\\u6d3b\\u52a8-0\": {\"last_ad_timestamp\": 1603884399, \"push_times\": 1, "
			+ "\"weekly_ad_date_list\": [\"2020-10-28\"], \"daily_times\": 0, \"last_ad_date\": \"2020-10-28\"}}, "
			+ "\"province_id\": \"19\", \"register_timestamp\": 1525071867, \"exp_course\": {\"pending_course_num\": "
			+ "0, \"reserve_effective_subject\": [], \"30days_nearly_expired_course\": {}, \"reserve_30days_subject\":"
			+ " [], \"attend_num\": 0, \"30days_nearly_course\": {}, \"latest_course\": {\"course_end_time\": "
			+ "1567251000.0, \"study_report_status\": 0, \"subject_id\": [\"3\"], \"answer_test_num\": 0, "
			+ "\"attend_status\": 0, \"course_id\": \"\", \"learn_duration_rate\": 0.0, \"course_begin_time\": "
			+ "1567248300.0, \"attend_duration\": 0}, \"reserve_30days_nearly_timestamp\": 0, \"reserve_30days_num\": "
			+ "0, \"30days_nearly_attend_course\": {}, \"attend_30days_num\": 0, \"immediate_course\": {}, "
			+ "\"attend_30days_nearly_timestamp\": 0, \"reserve_30days_timestamp_list\": [], \"attend_subject\": [], "
			+ "\"reserve_num\": 3, \"reserve_subject\": [\"1\", \"3\", \"2\"], \"latest_expired_course\": "
			+ "{\"course_end_time\": 1567251000.0, \"study_report_status\": 0, \"subject_id\": [\"3\"], "
			+ "\"answer_test_num\": 0, \"attend_status\": 0, \"course_id\": \"\", \"learn_duration_rate\": 0.0, "
			+ "\"course_begin_time\": 1567248300.0, \"attend_duration\": 0}, \"reserve_effective_num\": 0, "
			+ "\"pending_course_subject\": [], \"attend_30days_timestamp_list\": [], \"attend_30days_subject\": [], "
			+ "\"last_attend_course\": {}}, \"hotpot_type\": \"-1\", \"jingpinke_times\": 0, \"weekly_times\": 6, "
			+ "\"total_real_price\": \"22130.00\", \"all_buy_year_term\": "
			+ "\"202|202|202|201|201|201|194|194|194|193|193|193|193|193|192|192|191|191|184|184|183|183|182|182|181"
			+ "|181\", \"youxuanke_curterm_num\": 0, \"last_ad_timestamp\": 1604213240, \"request_info\": "
			+ "{\"request_grade\": \"6\", \"is_first_login\": \"\", \"request_hour\": \"15\", \"devicemodel\": \"\", "
			+ "\"request_device_version\": \"9\", \"request_week\": 6, \"xgrade\": \"\", \"request_net\": \"wifi\", "
			+ "\"request_device\": \"android\", \"app_version\": \"81101\"}, \"baopinke_last_interval\": 506261, "
			+ "\"all_course_subject_num\": 13, \"grade_id\": 6, \"lastterm_course_subject\": \"26|59|3\", "
			+ "\"jingpinke_last_interval\": 0, \"year_id\": \"16\", \"modify_time\": \"2020-08-1217:29:48\", "
			+ "\"last_year_term\": 202, \"qita_weekly_times\": 2, \"all_course_ids\": "
			+ "\"55719|69213|59533|75471|57442|54664|75358|60485|76010|60483|79538|48600|55973|74418|80968|81243|76193"
			+ "|71856|56286|72818|50352|71954|56464|57104|56466|56460|56461|56462|72351|99869|83837|75518|50538|48582"
			+ "|56427|84225|66443|73893|84223|56503|80530|59314|99504|56504|56465|66147|76211|75907|87374|72599|56482"
			+ "|56502|53145|74818|76203|56455|74419|56454|60533|85033|72190|52600|60535|80833|76093|69795|106626|99423"
			+ "|56463|63266|81466|56556|73886|71622|56459|56458|54909|79715|97152|56457|56456|81018|56453|56452\"}";
		String ss = "{\"course\": {\"19_0_4\": [\"47\", \"3\", \"2\", \"23\"], \"18_2_2\": [\"3\", \"2\"], \"19_0_5\":"
			+ " [\"64\"], \"18-2-111\": [\"2\"], \"19_0_3\": [\"3\", \"59\"], \"all_course_num\": 92, \"18-0-221\": "
			+ "[\"1\", \"3\", \"2\", \"21\"], \"18_4_2\": [\"3\", \"2\"], \"20-3-221\": [\"3\"], \"19_1_3\": [\"3\"], "
			+ "\"19_1_2\": [\"26\", \"59\", \"3\"], \"18_0_5\": [\"42\"], \"18_0_4\": [\"21\", \"42\", \"30\", \"28\","
			+ " \"43\", \"1\", \"3\", \"2\"], \"19-4-219\": [\"26\"], \"18_0_3\": [\"3\", \"2\"], \"18_3_2\": [\"3\", "
			+ "\"2\"], \"19-7-111\": [\"3\", \"2\"], \"19-4-221\": [\"3\"], \"no_return_long_term_live_subject\": "
			+ "[\"3\", \"2\", \"59\", \"26\"], \"19_7_2\": [\"3\", \"2\"], \"19_8_2\": [\"3\", \"2\"], "
			+ "\"short_49_subject_list\": [], \"19-0-411\": [\"47\", \"64\", \"23\"], \"19_2_2\": [\"3\", \"2\"], "
			+ "\"long_term_live_subject\": [\"3\", \"2\", \"59\", \"26\"], \"19-1-221\": [\"3\"], "
			+ "\"finished_within_15days_course\": {\"19_0_4\": [\"2\"], \"19-0-221\": [\"2\"]}, "
			+ "\"no_return_course_list\": [\"55719\", \"69213\", \"59533\", \"75471\", \"57442\", \"54664\", "
			+ "\"75358\", \"76010\", \"60483\", \"79538\", \"48600\", \"76093\", \"74418\", \"80968\", \"81243\", "
			+ "\"76193\", \"71856\", \"56286\", \"72818\", \"99504\", \"71954\", \"56464\", \"57104\", \"56466\", "
			+ "\"56460\", \"56461\", \"56462\", \"72351\", \"99869\", \"83837\", \"75518\", \"50538\", \"48582\", "
			+ "\"56427\", \"84225\", \"66443\", \"73893\", \"84223\", \"56503\", \"80530\", \"59314\", \"56504\", "
			+ "\"56465\", \"66147\", \"76211\", \"75907\", \"87374\", \"72599\", \"56482\", \"56502\", \"53145\", "
			+ "\"74818\", \"76203\", \"56455\", \"74419\", \"56454\", \"60533\", \"85033\", \"50352\", \"52600\", "
			+ "\"80833\", \"55973\", \"69795\", \"106626\", \"99423\", \"56463\", \"63266\", \"81466\", \"56556\", "
			+ "\"73886\", \"71622\", \"56459\", \"56458\", \"54909\", \"79715\", \"97152\", \"56457\", \"56456\", "
			+ "\"81018\", \"56453\", \"56452\"], \"18-2-122\": [\"3\"], \"20-2-221\": [\"3\"], "
			+ "\"reading_long_term_live_subject\": [], \"18-1-111\": [\"3\", \"2\"], \"no_return_course_num\": 83, "
			+ "\"finished_within_7days_course\": {\"19_0_4\": [\"2\"], \"19-0-221\": [\"2\"]}, \"19-0-221\": [\"3\", "
			+ "\"2\", \"59\"], \"long_term_live_num\": 34, \"19-1-111\": [\"26\", \"59\", \"3\"], "
			+ "\"no_return_course_subject\": [\"26\", \"59\", \"21\", \"23\", \"42\", \"30\", \"28\", \"43\", \"1\", "
			+ "\"3\", \"2\", \"64\", \"47\"], \"19-4-111\": [\"26\", \"59\", \"3\"], \"20-2-111\": [\"3\", \"59\", "
			+ "\"26\"], \"20_2_3\": [\"3\"], \"18-4-111\": [\"3\", \"2\"], \"19-2-111\": [\"3\", \"2\"], \"20-3-111\":"
			+ " [\"3\", \"59\", \"26\"], \"all_course_subject\": [\"26\", \"59\", \"21\", \"23\", \"42\", \"30\", "
			+ "\"28\", \"43\", \"1\", \"3\", \"2\", \"64\", \"47\"], \"20_0_3\": [\"3\", \"26\"], \"20_0_4\": [\"3\"],"
			+ " \"about_to_start_course\": {\"20-0-221\": [\"26\"], \"20_0_3\": [\"26\"]}, "
			+ "\"reading_long_term_live_num\": 3, \"20-0-221\": [\"3\", \"26\"], \"course_list\": [\"55719\", "
			+ "\"69213\", \"59533\", \"75471\", \"57442\", \"54664\", \"75358\", \"60485\", \"76010\", \"60483\", "
			+ "\"79538\", \"48600\", \"55973\", \"74418\", \"80968\", \"81243\", \"76193\", \"71856\", \"56286\", "
			+ "\"72818\", \"50352\", \"71954\", \"56464\", \"57104\", \"56466\", \"56460\", \"56461\", \"56462\", "
			+ "\"72351\", \"99869\", \"83837\", \"75518\", \"50538\", \"48582\", \"56427\", \"84225\", \"66443\", "
			+ "\"73893\", \"84223\", \"56503\", \"80530\", \"59314\", \"99504\", \"56504\", \"56465\", \"66147\", "
			+ "\"76211\", \"75907\", \"87374\", \"72599\", \"56482\", \"56502\", \"53145\", \"74818\", \"76203\", "
			+ "\"56455\", \"74419\", \"56454\", \"60533\", \"85033\", \"72190\", \"52600\", \"60535\", \"80833\", "
			+ "\"76093\", \"69795\", \"106626\", \"99423\", \"56463\", \"63266\", \"81466\", \"56556\", \"73886\", "
			+ "\"71622\", \"56459\", \"56458\", \"54909\", \"79715\", \"97152\", \"56457\", \"56456\", \"81018\", "
			+ "\"56453\", \"56452\"], \"18-3-111\": [\"3\", \"2\"], \"on_going_course\": {\"19-0-411\": [\"47\", "
			+ "\"64\", \"23\"], \"19_0_4\": [\"47\", \"3\", \"2\", \"23\"], \"19_0_5\": [\"64\"], \"20_3_3\": [\"3\"],"
			+ " \"18-0-221\": [\"1\"], \"20-3-221\": [\"3\"], \"20-3-111\": [\"3\", \"59\", \"26\"], \"18_0_4\": "
			+ "[\"1\", \"28\", \"30\", \"42\", \"43\"], \"18-0-411\": [\"28\", \"30\", \"42\", \"43\"], \"20-0-221\": "
			+ "[\"3\"], \"20_0_4\": [\"3\"], \"20_3_2\": [\"3\", \"59\", \"26\"], \"19-0-221\": [\"3\", \"2\"]}, "
			+ "\"18_1_2\": [\"3\", \"2\"], \"19-0-231\": [\"3\"], \"no_return_long_term_live_num\": 26, "
			+ "\"final_plan_timestamp\": {\"18-0-221\": 1643558400.0, \"20-3-221\": 1609759200.0, \"20-3-111\": "
			+ "1609666800.0, \"19-7-111\": 1569407400.0, \"18-2-111\": 1533353400.0, \"19-4-221\": 1579782000.0, "
			+ "\"18-1-111\": 1561545600.0, \"19-0-411\": 1610640000.0, \"19-1-221\": 1592828400.0, \"19-1-111\": "
			+ "1592733000.0, \"18-0-411\": 1610985600.0, \"20-0-221\": 1631376000.0, \"20-2-111\": 1598443200.0, "
			+ "\"18-2-122\": 1532318400.0, \"19-4-111\": 1581336600.0, \"18-4-111\": 1550235600.0, \"19-2-111\": "
			+ "1565341200.0, \"18-3-111\": 1547635200.0, \"19-4-219\": 1577448600.0, \"19-0-231\": 1576756800.0, "
			+ "\"20-2-221\": 1597407600.0, \"19-8-111\": 1578479400.0, \"19-0-221\": 1612800000.0}, \"20_2_2\": "
			+ "[\"3\", \"59\", \"26\"], \"18-0-411\": [\"42\", \"30\", \"28\", \"43\"], \"19-8-111\": [\"3\", \"2\"], "
			+ "\"19_4_2\": [\"26\", \"59\", \"3\"], \"19_4_3\": [\"3\"], \"20_3_3\": [\"3\"], \"20_3_2\": [\"3\", "
			+ "\"59\", \"26\"], \"19_4_7\": [\"26\"]}}";
		Row[] rows = new Row[] {
			Row.of(s)
		};
		BatchOperator source = new MemSourceBatchOp(rows, new String[] {"json"});
		String schema = "course string, youxuanke_course_subject string";
		JsonToColumnsBatchOp json = new JsonToColumnsBatchOp()
			.setJsonCol("json")
			.setReservedCols(new String[0])
			.setSchemaStr(schema)
			.linkFrom(source);
		JsonToColumnsBatchOp json2 = new JsonToColumnsBatchOp()
			.setJsonCol("youxuanke_course_subject")
			.setHandleInvalid("SKIP")
			.setSchemaStr("qwe string, qwer int");
		json.link(json2).print();
		//Map<Object, Object> map = JsonConverter.fromJson(s, Map.class);
		//for (Entry <Object, Object> entry : map.entrySet()) {
		//	System.out.println(entry.getKey());
		//}
	}

}